package com.lson.bus;

import com.lson.kafka.stream.entity.ProducerMsg;
import org.springframework.stereotype.Service;

@Service
public class BusProducerService  {

    protected void fireEvent(String eventAction, ProducerMsg producerMsg) {
        System.out.println(ApplicationContextHolder.getApplicationContext().getId());
        ProductEvent productEvent = new ProductEvent(producerMsg,
                ApplicationContextHolder.getApplicationContext().getId(), "*:**",
                eventAction, producerMsg.getId());

        // 发布事件
        RemoteApplicationEventPublisher.publishEvent(productEvent);
    }
}
